Repository navigation
Test that the environment fails closed per variable and is read once - #41
Merged
Merged
Conversation
Pins two parts of the 0.4.0 opt-out contract that had no test: one unreadable variable disables reporting even when the other says "on", and the environment is consulted only in the constructor, so a later change neither stops an enabled client nor starts a disabled one. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Member
Author
|
Self-review rubric (anchored on CI run 44688680905 on the PR head):
Findings for a human to weigh:
Summary: a tests-only Stage B PR that is green on every CI leg and touches no do-not-auto-merge path. This comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stage B (unit-test expansion) for the opt-out contract made fail-closed in 0.4.0 (#40). Tests only; no production code is changed.
EnvironmentDisables_IsTrueWhenEitherVariableAloneCannotBeRead— the existing sandbox test makes every environment read throw. This theory makes only one variable unreadable while the other reads as clearly "on" (TRACE_USAGE_REPORTING=onorDO_NOT_TRACK=0), and pins that the client still fails closed with reasonenvironmentand sends nothing.Environment_IsReadOnceInTheConstructorSoALaterOptOutDoesNotStopAClient—DisabledReasonis documented as "decided once, in the constructor". SettingDO_NOT_TRACK=1after construction is shown to leave an enabled client reporting, whileEnvironmentDisables()already answerstrue.Environment_IsReadOnceInTheConstructorSoALaterOptInDoesNotStartAClient— the reverse: clearingTRACE_USAGE_REPORTING=offafter construction does not turn a disabled client back on ("nothing in this client ever turns a switch back on").These are characterization tests of current, documented behaviour. The second test pins a property a maintainer may later choose to change (re-checking the environment per report); if so, it is the test to update.
No tracking issue — the gap was found during triage by reading the constructor and
EnvironmentDisablesagainstTraceClientTest.cs.Skipped issues
All three open issues are behaviour-contract decisions reserved for the maintainer, so none was picked:
Drain/Close.User-Agent) — changes the wire format.Test plan
Buildworkflow green on ubuntu-latest (net8.0)Buildworkflow green on windows-latest (net8.0 + net48)dotnetis not installed in the sandbox this PR was prepared in, so the tests were not run locally; the CI matrix on the PR head is the verification.This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
🤖 Generated with Claude Code
drafted by Claude on behalf of Daniel Stephenson